package com.zkzx.operation.api.controller.menu;


import com.zkzx.operation.api.controller.BaseController;
import com.zkzx.operation.api.controller.menu.vo.MenuVO;
import com.zkzx.operation.api.service.menu.MenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@Validated
@Api( tags="菜单栏目")
@RequestMapping(value = "/menus")
public class MenuController extends BaseController {

    @Autowired
    private MenuService menuService;

    @GetMapping
    @ResponseStatus(HttpStatus.OK)
    @ApiOperation(value = "获取用户菜单权限", notes = "获取用户的菜单权限")
    public List<MenuVO> getCityDeliveryVo() {
        return menuService.findMenusByUserId(super.getUserId());
    }




}
